<template>
    <div class="app-container">
        <el-card>
            <el-table :data="tableData.data" v-loading="listLoading" stripe border>
                <el-table-column prop="groupId" align="center" label="群组ID"></el-table-column>
                <el-table-column prop="groupName" align="center" label="群组名称"></el-table-column>
                <el-table-column prop="groupRegisterTime" align="center" label="群注册时间"></el-table-column>
                <el-table-column prop="groupLastMsgTime" align="center" label="群最近发消息时间"></el-table-column>
                <el-table-column prop="lastTipoffTime" align="center" label="最近举报时间"></el-table-column>
            </el-table>
            <div class="pageRight">
                <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    layout="total, sizes,prev, pager, next,jumper" :current-page.sync="whereForm.pageNum"
                    :page-size="whereForm.pageSize" :page-sizes="[10, 15, 20]" :total="tableData.total">
                </el-pagination>
            </div>
        </el-card>
    </div>
</template>
<script>
import { getImsGroupList, getImsGroupMemberList, setGroupSilence, delGroup } from '@/api/im'
export default {
    data() {
        return {
            whereForm: {
                pageNum: 1,
                pageSize: 10
            },
            tableData: {
                data: [],
                total: 0
            },
            listLoading: false,
        }
    },
    created() {
        this.getList();
    },
    methods: {
        handleSizeChange(val) {
            this.whereForm.pageNum = 1;
            this.whereForm.pageSize = val;
            this.getList();
        },
        
        handleCurrentChange(val) {
            this.whereForm.pageNum = val;
            this.getList();
        },
        getList() {
            this.listLoading = true;
            getImsGroupList(this.whereForm).then(res => {
                this.tableData.data = res.data.list;
                this.tableData.total = res.data.total;
            }).finally(() => {
                this.listLoading = false;
            })
        }
    }
}
</script>